package it.unical.mat.aec.processTests;

import java.io.File;

public class DirectorTests {
	private BuilderTests builderTests;
	
	public DirectorTests() {
	}
	

	public void configuraBuilderTests(BuilderTests builderTests) {
		this.builderTests = builderTests;
	}
	
	public void caricaTests(File []files) throws LettoreFileTestException, FileNonValidoException{
		String errors=null;
		for(int i=0;i<files.length;i++)
			try {
				builderTests.caricaTest(files[i]);
			} catch (LettoreFileTestException e) {
				if(errors==null)
					errors=new String();
				errors=errors.concat(e.getMessage()+"\n");
			}
		if(errors!=null)
			throw new LettoreFileTestException(errors);
	}
	
}
